<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>订单:${order.OId }的详情</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<style type="text/css">
		body {TEXT-ALIGN: center;}
		#order_detail {
			MARGIN-RIGHT: auto;
			MARGIN-LEFT: auto;
		}
	</style>
  </head>
  
  <body>
  <div id='order_detail'>
	 <h1>用户信息：</h1>
	 <table width="500" border="1" align="center">
	   <tr>
	     <td width="92">用户名：</td>
	     <td width="396">${user.username }</td>
	   </tr>
	   <tr>
	     <td>姓名：</td>
	     <td>${user.UName }</td>
	   </tr>
	   <tr>
	     <td>用户类别：</td>
	     <td>
	     	<c:choose>
	     		<c:when test="${user.userLevel == 1}">
	     			普通会员
	     		</c:when>
	     		<c:when test="${user.userLevel == 2}">
	     			高级会员
	     		</c:when>
	     		<c:when test="${user.userLevel == 3}">
	     			VIP会员
	     		</c:when>
	     	</c:choose>
	     </td>
	   </tr>
	   <tr>
	     <td>公司：</td>
	     <td>${user.company }</td>
	   </tr>
	   <tr>
	     <td>手机：</td>
	     <td>${user.mobile }</td>
	   </tr>
	   <tr>
	     <td>地址：</td>
	     <td>${user.address }</td>
	   </tr>
	 </table>
	 <h1>订单信息：</h1>
	 <table width="500" border="1" align="center">
	   <tr>
	     <td width="92">订单编号：</td>
	     <td width="394">${order.OId}</td>
	   </tr>
	   <tr>
	     <td>下单日期：</td>
	     <td>
	     	<fmt:formatDate value="${order.OTime}" pattern="yyyy-MM-dd HH:ss:mm"/>
	     </td>
	   </tr>
	   <tr>
	     <td>商品数量：</td>
	     <td>${order.OSumNum}</td>
	   </tr>
	   <tr>
	     <td>总价：</td>
	     <td>${order.OSumPrice }</td>
	   </tr>
	   <tr>
	     <td>订单状态：</td>
	     <td>
		<c:choose>
			<c:when test="${order.OState}">
				已处理
			</c:when>
			<c:otherwise>
				未处理
			</c:otherwise>
		</c:choose>
	  </td>
	   </tr>
	 </table>
	 <h1>订单条目:</h1>
	 <table width="500" border="1" align="center">
	   <tr>
	     <td>商品编号</td>
	     <td>商品名称</td>
	     <td>商品型号</td>
	     <td>单价</td>
	     <td>数量</td>
	     <td>总价</td>
	   </tr>
	   <c:forEach items="${oList}" var="item">
	   	<tr>
	      <td>${item.products.PId}</td>
	      <td>${item.products.PName}</td>
	      <td>${item.products.model }</td>
	      <td>
	      	<c:forEach items="${item.products.prices}" var="price">
	      		<c:if test="${price.ULevel == user.userLevel}">
	      			${price.price}
	      		</c:if>
	      	</c:forEach>
	      </td>
	      <td>${item.LNum}</td>
	      <td>${item.LSumPrice}</td>
	   	</tr>
	   </c:forEach>
	   
	 </table>
	 <a href='#' onclick="return window.close()">关闭</a>
  </div>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  </body>
</html>
